import BaseControl from "../BaseControl";
import Renderer from "./Renderer.vue";
import PropEditor from "./PropsEditor.vue";
import Viewer from './Viewer.vue';
import Input from "../input";
import {remoteOption} from "../../remoteData";

class Control extends BaseControl {
    constructor() {
        super("businessLicenseDistinguish", "营业执照识别");
        let nameList = ['信用代码', '名称', '组成形式', '类型', '注册日期', '经营者', '经营场所', '经营范围', '图片路径']
        let controls = nameList.map(label => new Input.Control({label, required: true, disabled: true, lock: true}))
        this.props = {
            type: 'businessLicenseDistinguish',
            width: 12,
            showLabel: false,
            required: false,
            requiredMessage: '必填字段',
            labelWidth: undefined,
            label: '营业执照识别',
            enName: '',//英文名称
            remark: '',//描述信息
            columns: [
                {
                    label: '营业执照信息',
                    controls
                }
            ],
            remoteOption: {
                ...remoteOption,
                fieldsMap: nameList.reduce((p, c) => {
                    p[c] = '';
                    return p
                }, {})
            }
        };
    }
}

Control.type = "businessLicenseDistinguish";
Control.label = "营业执照识别";
export default {Control, Renderer, PropEditor, Viewer};
